package main

import "fmt"

type Fruit interface {
	eat()
}

type Apple struct {
	flavor string
}

func (apple Apple) eat() {
	fmt.Println("eat apple")
}

func main() {
	var f Fruit
	fmt.Printf("%T\n",f)	//动态类型：没有赋值，输出nil

	f = new(Apple)

	fmt.Printf("%T",f)	//动态类型：Apple
}
